package com.example.gss.Service;

import com.example.gss.entity.ScholarshipApplication;

import java.util.List;
import java.util.Optional;

public interface ScholarshipApplicationService {
    /**
     * 创建奖学金申请
     */
    ScholarshipApplication createApplication(ScholarshipApplication application);

    /**
     * 获取所有奖学金申请
     */
    List<ScholarshipApplication> getAllApplications();

    /**
     * 根据ID获取奖学金申请
     */
    Optional<ScholarshipApplication> getApplicationById(String applicationId);

    /**
     * 更新奖学金申请信息
     */
    ScholarshipApplication updateApplication(ScholarshipApplication application);

    /**
     * 删除奖学金申请
     */
    void deleteApplication(String applicationId);

    /**
     * 根据学生ID查询奖学金申请
     */
    List<ScholarshipApplication> findApplicationsByStudentId(String studentId);

    /**
     * 根据奖学金ID查询申请
     */
    List<ScholarshipApplication> findApplicationsByScholarshipId(String scholarshipId);

    /**
     * 根据状态查询申请
     */
    List<ScholarshipApplication> findApplicationsByStatus(String status);

    /**
     * 重新计算申请的总分
     */
    ScholarshipApplication recalculateTotalScore(String applicationId);

    /**
     * 检查学生是否已经申请过该奖学金
     */
    boolean hasExistingApplication(String studentId, String scholarshipId);

    /**
     * 获取学生对该奖学金的现有申请
     */
    Optional<ScholarshipApplication> getExistingApplication(String studentId, String scholarshipId);

    /**
     * 创建或更新申请（如果已存在则覆盖）
     */
    ScholarshipApplication createOrUpdateApplication(ScholarshipApplication application);
}